<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%  
	String path = request.getContextPath();  
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css">
<script src="/bsc/static/js/jquery-3.1.1.js"></script>
<script src="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>

</head>
<body>
		<center>
			<form action="<%=basePath%>update" method="post" enctype="multipart/form-data">
				<table class="table table-bordered">
					<input type="hidden" name="project_id" id="project_id" value="${project.project_id }"/>
					<tr>
						<td>项目姓名：</td>
						<td>
							<input type="text"  name="project_name" value="${project.project_name }"/>
						</td>
						<td>状态：</td>
						<td>
							<select name="status" >	
								<option value="1" ${project.status== '1' ?'selected':'' }>在售</option>
								<option value="2" ${project.status=='2' ?'selected':'' }>下架</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>列表图片：</td>
						<td>
						 <input type="hidden" value="${project.cover_photo }" name="photoname1">
							<input type="file"   name="file" />
							<div style="width:100px; height:100px; border-radius:50%; overflow:hidden;">
								<img width="100px" height="100px" src="/bsc${project.cover_photo }" id="cover_photo"/>
							</div> 
						</td>
						<td>封面图片：</td>
						<td>
						    <input type="hidden" value="${project.cover_big_photo }" name="photoname2">
							<input type="file" name="file" />
							<div style="width:100px; height:100px; border-radius:50%; overflow:hidden;">
								<img width="100px" height="100px" src="/bsc${project.cover_big_photo }" id="cover_big_photo"/>
							</div>
						</td>
					</tr>
					<tr>
						<td>分类：</td>
						<td>
							<select name="type_id" id="type_id">
								<c:forEach items="${listb}" var="t">
										<option value="${t.type_id }"${project.type_id==t.type_id ?"selected":"" }>${t.type_name}</option>
								</c:forEach>
							</select>
						</td>
						<td>所有设备：</td>
						<td>
							<input type="text" name="use_device" value="${project.use_device }"/>
						</td>
					</tr>
					<tr>
						<td>服务时长：</td>
						<td>
							<input type="text" id="zhi1" name="server_time" value="${project.server_time }"/>
							<input type="button" id="jian1" value="-"/>	
							<input type="button" id="jia1" value="+"/> 分钟
						</td>
						<td>人民币售价：</td>
						<td>
							<input type="text" id="zhi2" name="rmb_price" value="${project.rmb_price }"/>
							<input type="button" id="jian2" value="-"/>	
							<input type="button" id="jia2" value="+"/> 元
						</td>
					</tr>
					<tr>
						<td>颜值售价：</td>
						<td>
							<input type="text" id="zhi3" name="beauty_price" value="${project.beauty_price }"/>
							<input type="button" id="jian3" value="-"/>	
							<input type="button" id="jia3" value="+"/> 个
						</td>
						<td>标准手工费：</td>
						<td>
							<input type="text" id="zhi4" name="manual_price" value="${project.manual_price }"/>
							<input type="button" id="jian4" value="-"/>	
							<input type="button" id="jia4" value="+"/> 元
						</td>
					</tr>
					<tr>
						<td>活动手工费：</td>
						<td>	
							<input type="text" id="zhi5" name="active_price" value="${project.active_price }"/>
							<input type="button" id="jian5" value="-"/>	
							<input type="button" id="jia5" value="+"/> 元
						</td>
						<td>排序号：</td>
						<td>
							<input type="text" id="zhi6" name="sort_no" value="${project.sort_no }"/>
							<input type="button" id="jian6" value="-"/>	
							<input type="button" id="jia6" value="+"/> 个
						</td>
					</tr>
					<tr>
						<td >内容描述</td>
						<td colspan="3">
							<textarea rows="" cols="" name="content">
								
							</textarea>
						</td>
						
					</tr>
					<tr align="center">
						<td colspan="4">
							<input type="submit" value="提交" /> 
							<input type="button" value="关闭" onclick="custom_close()"/>
						</td>
					</tr>
				</table>
			</form>
		</center>
</body>
</html>

<script type="text/javascript">

function custom_close(){
    if(confirm("您确定要关闭本页吗？")){
        window.opener=null;
        window.location.href = "<%=basePath%>selectproject"; 
        window.close();
    }
    else{
    }
}

$(function(){
	/* var zhi1 = document.getElementById("zhi1").value; */
	var zhi1 = parseInt($("#zhi1").val());
	$("#zhi1").val(zhi1);
	$("#jian1").on("click",function(){
		if(zhi1>1){
			zhi1 = zhi1 - 1;
		}
		$("#zhi1").val(zhi1);
	});
	
	$("#jia1").on("click",function(){
		
			zhi1 = zhi1 + 1;
		
		$("#zhi1").val(zhi1);
	});
	
	
	var zhi2 = parseInt($("#zhi2").val());
	
	$("#zhi2").val(zhi2);
	$("#jian2").on("click",function(){
		if(zhi2>1){
			zhi2 = zhi2 - 1;
		}
		$("#zhi2").val(zhi2);
	});
	
	$("#jia2").on("click",function(){
		
			zhi2 = zhi2 + 1;
		
		$("#zhi2").val(zhi2);
	});
	
	var zhi3 = parseInt($("#zhi3").val());
	
	$("#zhi3").val(zhi3);
	$("#jian3").on("click",function(){
		if(zhi3>1){
			zhi3 = zhi3 - 1;
		}
		$("#zhi3").val(zhi3);
	});
	
	$("#jia3").on("click",function(){
		
			zhi3 = zhi3 + 1;
		
		$("#zhi3").val(zhi3);
	});
	
	var zhi4 = parseInt($("#zhi4").val());
	
	$("#zhi4").val(zhi4);
	$("#jian4").on("click",function(){
		if(zhi4>1){
			zhi4 = zhi4 - 1;
		}
		$("#zhi4").val(zhi4);
	});
	
	$("#jia4").on("click",function(){
		
			zhi4 = zhi4 + 1;
		
		$("#zhi4").val(zhi4);
	});
	
	var zhi5 = parseInt($("#zhi5").val());
	
	$("#zhi5").val(zhi5);
	$("#jian5").on("click",function(){
		if(zhi5>1){
			zhi5 = zhi5 - 1;
		}
		$("#zhi5").val(zhi5);
	});
	
	$("#jia5").on("click",function(){
		
			zhi5 = zhi5 + 1;
		
		$("#zhi5").val(zhi5);
	});
	
	var zhi6 = parseInt($("#zhi6").val());
	
	$("#zhi6").val(zhi6);
	$("#jian6").on("click",function(){
		if(zhi6>1){
			zhi6 = zhi6 - 1;
		}
		$("#zhi6").val(zhi6);
	});
	
	$("#jia6").on("click",function(){
		
			zhi6 = zhi6 + 1;
		
		$("#zhi6").val(zhi6);
	});
	
});

</script>
